package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * _*_ coding : utf-8 _*_
 *
 * @Time : 2023/7/29 20:38
 * @Author : 计201任思伟
 * @File : UserMapper
 * @Project : sky-take-out
 */
@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid=#{openid};")
    User getByOpenId(String openid);

    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    @Select("select * from user where id=#{userId};")
    User getById(Long userId);

    Integer countByMap(Map map);
}
